} if (val) { copyText(val); reportMarketing('copy', el, val); } }); // 选择:选中文本时记录 select(用 mouseup/touchend/keyup,避免 selectionchange 过于频繁) $(document).on('mouseup touchend', function () { setTimeout(reportSelectIfAny, 0); }); $(document).on('keyup', function (e) { // 常见的键盘选择:Shift+方向键 if (e && e.shiftKey) { setTimeout(reportSelectIfAny, 0); } }); // 复制:Ctrl+C / 右键复制(只能可靠拿到“选中文本”的复制) document.addEventListener('copy', function () { setTimeout(reportCopyIfAny, 0); }); })();
Choose another language
×